package cn.itcast.com.day03;

public class test1 {
    public static void main(String[] args) {
        //mn np 就是mxn个数的循环
        int[][] a = {{1,2},{3,4},{5,6}};
        int[][] b = {{1,2,3,4},{5,6,7,8}};
        int[][] c = new int[3][4];
        for(int i = 0; i < a.length; i++) {
            //因为要获得列数所以要访问获得一维数组的长度
            for(int j = 0; j < b[0].length; j++) {
                for(int k = 0; k < 2; k++) {
                    c[i][j] += a[i][k]*b[k][j];
                }
            }
        }

        for(int i = 0; i < c.length; i++) {
            for(int j = 0; j < c[0].length; j++)
                System.out.print(c[i][j]+" ");
            System.out.println();
        }
    }
}
